/* eslint-disable @typescript-eslint/no-empty-function */
import { moduleRequest } from "@/api/request";
import { ReqId, ResPage, SysFile } from "@/api/";

const http = moduleRequest("/sys/dev/file/");

const fileAPI = {
  page(params: SysFile.Page) {
    return http.get<ResPage<SysFile.SysFileInfo>>("page", params);
  },
  uploadLocal(params: FormData) {
    return http.post("uploadLocal", params);
  },
  download(params: ReqId) {
    return http.get<Blob>("download", params, { responseType: "blob" });
  },
  delete(params: { ids: string[] }) {
    return http.post("delete", params);
  },
  rename(params: FormData) {
    return http.post("rename", params, { headers: { "Content-Type": "application/json" } });
  }
};

export { fileAPI };
